import mockAS2.IMockAS2;

/**
 * Copyright (c) 2012 Gary Higham
 * Released under the MIT license
 * https://code.google.com/p/mock-as2/wiki/License
 *
 * Version: v0.1
 */
class mockAS2.Sandbox {
	private var itemsToBeRestored : Array;
	
	public function Sandbox() {
		itemsToBeRestored = new Array();
	}

	public function addItem(mockAS2Component : IMockAS2) : Void {
		itemsToBeRestored.push(mockAS2Component);
	}

	public function restore() : Void {
		for(var i : Number = 0; i < itemsToBeRestored.length; ++i) {
			IMockAS2(itemsToBeRestored[i]).restore();
		}
	}
}
